<?php

namespace services\models\minisite;
/**
 * This is the ActiveQuery class for [[\common\models\TActivityShowFeelStatistics]].
 *
 * @see \common\models\TActivityShowFeelStatistics
 */
class TActivityShowFeelStatisticsQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        return $this->andWhere('[[status]]=1');
    }*/

    /**
     * @inheritdoc
     * @return \services\models\minisite\MActivityShowFeelStatistics[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return \services\models\minisite\MActivityShowFeelStatistics|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }

    /**
     * 更新浏览数
     * @param $asf_id
     *
     */
    public function viewTimesCount($asf_id)
    {
        MActivityShowFeelStatistics::updateAllCounters(['c_view_times'=>1], 'asf_id= :asf_id', [':asf_id'=>$asf_id]);
    }

    /**
     * 更新点赞数
     * @param $asf_id
     */
    public function likeTimesCount($asf_id)
    {
        MActivityShowFeelStatistics::updateAllCounters(['c_like_times'=>1], 'asf_id= :asf_id', [':asf_id'=>$asf_id]);
    }
    
    
}
